package com.sinven.service;

import com.sinven.common.ApiResult;
import com.sinven.mapper.UserMapper;
import com.sinven.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public ApiResult<User> selectByNum(String num) {
        ApiResult<User> api=new ApiResult<User>();
        User user=userMapper.selectByNum(num);
        System.out.println(num);
        System.out.println(user.getUaddress());
        if(user!=null){
            api.setData(user);
            api.setCode(0);
            return api;
        }
        api.setCode(1);
        return api;
    }
}
